<template>
  <div class="son">
    <h1>我是Son组件(孙)</h1>
    <h1>汽车: {{ name }}--{{ price }}</h1>
  </div>
</template>
  
  <script>
    import { toRefs,inject } from 'vue';
    export default {
    name: "Son",
    setup(){
        let car = inject("car")
        return { ...toRefs(car)}
    }
    };
</script>
  
  <style>
.son {
  background-color: orange;
  padding: 10px;
}
</style>